﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

namespace com.codeplex.eatoutadvocate.Web.Mvc.Utility
{
    public class LogUtility
    {
        public static void ProcessException(string category, string message)
        {
            try
            {
                string source = "EatOutAdvocate";
                if (!EventLog.SourceExists(source))
                {
                    EventLog.CreateEventSource(source, "Application");
                }
                EventLog.WriteEntry(source, "Category: " + category + Environment.NewLine + message);
            }
            finally
            {
                // dispose resources if any
            }
        }
    }
}